package com.biodiv.miracle.ioc.processor;

import com.biodiv.miracle.aop.proxy.ProxyRegistration;

/**
 * @Author: tianquan
 * @CreateTime: 2025-05-25  11:03
 * @Description: 代理后置处理器
 */
public class PoxyBeanPostProcessor implements ProxyPostProcessor {

    private final ProxyRegistration proxyRegistration;

    public PoxyBeanPostProcessor(ProxyRegistration proxyRegistration) {
        this.proxyRegistration = proxyRegistration;
    }

    @Override
    public Object createProxy(Object target) {
       return proxyRegistration.isNecessaryCreateProxy(target);
    }

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) {
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) {
        return bean;
    }

}
